﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace new和override区别
{
    class Program
    {
        static void Main(string[] args)
        {
            GrandClass Parent = (GrandClass)new ParentClass();//用override子类加框一个基类对象句柄
            Parent.Method();
            GrandClass NewParent = (GrandClass)new NewParentClass();//用new子类加框一个基类对象句柄
            NewParent.Method();
            NewParentClass NewParent1 = new NewParentClass();//一个子类句柄
            NewParent1.Method();

            Console.ReadLine();
        }
    }
}
